var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
	var s = req.session;
	console.log(req.url);
	if(s.loged && req.url.indexOf('/login') == -1){
		console.log('session')
		next();
	}else{
		res.sendfile('public/views/index.html');
	}
	
});


module.exports = router;
